package javabase;

import java.util.Arrays;

public class Chapter_06_04 {

	public static void main(String[] args) {
		int oldArr[]= {1,3,4,5,0,0,6,6,0,5,4,7,6,7,0,5};
		int a[]=new int[oldArr.length];
		int i,t=0;
		for(i=0;i<oldArr.length;i++)
		{
			if(oldArr[i]!=0)
			{
				a[t]=oldArr[i];
				t++;
			}
		}
		int newArr[]=Arrays.copyOf(a, t);
		System.out.println(Arrays.toString(newArr));

	}

}
